
import java.io.IOException;
import javax.microedition.lcdui.*;
import javax.microedition.lcdui.game.*;


public class c extends GameCanvas implements Runnable {

    private LayerManager mLayerManager;
    private Sprite l;
    int x = getWidth()/2-61;
    int y = getHeight()/2+99;
    private boolean isAlive = true;
    private int startframe;
    private int frameformove = 5;
    private int i;
    private Sprite l2;


    public c() {
        super(true);
        mLayerManager = new LayerManager();
        Graphics g = getGraphics();
        createl2(g);
        createl(g);

        Thread t = new Thread(this);
        t.start();

        setFullScreenMode(true);
    }


    private void createl2(Graphics g) {
        try {
            Image mImage = Image.createImage("/iclogo.png");
            l = new Sprite(mImage, 75, 75);
            l.setPosition(getWidth()/2-37, y-99);
            l.defineReferencePixel(64, 64);
            mLayerManager.append(l);
        }
        catch (IOException ex) {
            ex.printStackTrace();
        }
    }

    private void createl(Graphics g) {
        try {
            Image mImage = Image.createImage("/load.png");
            l = new Sprite(mImage, 122, 14);
            l.setPosition(x, y);
            l.defineReferencePixel(64, 64);
            mLayerManager.append(l);
        }
        catch (IOException ex) {
            ex.printStackTrace();
        }
    }

    public void run() {
        while (true) {
            try {

                Graphics g = getGraphics();
                g.setColor(0xffffff);
                g.fillRect(0, 0, this.getWidth(), getHeight());
                mLayerManager.paint(g, 0, 0);
                flushGraphics();

                Thread.currentThread().sleep(500);

                 l.setPosition(x, y);
                 l.setFrame(startframe + i++);
                 if (i > frameformove) {
                     i = 0;

                 }



         }

         catch (InterruptedException ex) {
             ex.printStackTrace();
         }
            }
}
}





